package YNU;

import YNU.View.StudentView;
import YNU.View.impl.StudentViewImpl;
import YNU.po.Student;

import java.util.Scanner;

public class StudentEntry {
    public void work() {
        Scanner input = new Scanner(System.in);

        System.out.println("----------------------------------");
        System.out.println("|\t\t\t 学生成绩查询系统  \t\t\t|");
        System.out.println("----------------------------------");
        StudentView studentView = new StudentViewImpl();
        Student student = studentView.login();
        System.out.println("您已经登录上了系统");
        if (student != null) {
            int menu = 0;
            while (menu != 5) {
                //输出主菜单
                System.out.println("\n1.查询成绩\t2.修改密码\t其他选择:退出系统");
                System.out.println("请输入你的选择：");
                menu = input.nextInt();

                switch (menu) {
                    case 1:
                        System.out.println("查询成绩需要输入名字和密码");
                        studentView.listStudent();
                        break;
                    case 2:
                        studentView.updateStudentByPassword(student.getSid());
                        break;
                    default:
                        System.out.println("已退出系统");
                        break;

                }


            }
        }
    }
    public static void main (String[]args){
        new StudentEntry().work();
		/*
		ElmAdminEntry elmAdminEntry=new ElmAdminEntry();
		elmAdminEntry.work();*/
    }
}
